package util;

public class ClientProtocol {
	
	public final static String INT_MATCHER = "^([0-9]*)$";
	public final static String LOGIN_OK_MATCHER = "^sequenceId=([0-9]*);msgType=loginClientOk$";
	public final static String LOGIN_DUPLICATE_ERROR_MATCHER = "^sequenceId=([0-9]*);msgType=loginErrorDuplicateName$";
	public final static String LOGIN_INVALID_ERROR_MATCHER = "^sequenceId=([0-9]*);msgType=loginErrorInvalidName$";
	public final static String NEW_ORDER_OK_MATCHER = "^sequenceId=([0-9]*);referenceId=([0-9]*);msgType=newOrderOk;ticket=([A-Z]{3});type=([A-Z]);side=([A-Z]);amount=([0-9]*);price=([-+]?[0-9]*\\.?[0-9]*[eE]?[0-9]*)$";
	public final static String MATCH_ORDER_MATCHER =  "^sequenceId=([0-9]*);referenceId=([0-9]*);matchReferenceId=([0-9]*);msgType=matchOrder;filled=([FP]);amount=([0-9]*);amountLeft=([0-9]*);price=([-+]?[0-9]*\\.?[0-9]*[eE]?[0-9]*)$";
	public final static String CANCEL_ORDER_DONE_MATCHER = "^sequenceId=([0-9]*);referenceId=([0-9]*);msgType=cancelOrderDone$";
	public final static String CANCEL_ORDER_ERROR_MATCHER = "^sequenceId=([0-9]*);msgType=cancelOrder";
	public final static String FAREWELL_MATCHER = "^sequenceId=([0-9]*);bye$";
	public final static String HEARTBEAT_MATCHER = "^sequenceId=([0-9]*);a$";
	public final static String ORDERLIST_ELEMENT_MATCHER = "^referenceId=([0-9]*);amount=([0-9]*)$";
	
	public final static String HEARTBEAT = "a";
	public final static String FAREWELL = "bye";

	public final static int HEARTGAP = 10 * 1000;
	public final static int WAITGAP = 15 * 1000;
	
}
